package com.now.service.impl;

import com.now.entity.User;
import com.now.mapper.UserMapper;
import com.now.service.IUserService;
import com.now.utils.AesUtil;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

/**
 * @Desc TODO
 * @Author TMC
 * @Date 2024/7/22 11:00
 * @Version 1.0
 */
@Service
public class UserServiceImpl implements IUserService{

    @Resource
    UserMapper userMapper;


    @Override
    public User queryByUsername(String username) {
        return userMapper.queryByUsername(username);
    }

    @Override
    public boolean save(String username, String password) {
        // 密码加密
        String newPassword = AesUtil.encrypt(password);
        return userMapper.save(username, newPassword);
    }
}
